added this function
authorHavoc Pennington <hp@redhat.com>
Fri, 8 Jun 2001 19:03:23 +0000 (19:03 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Fri, 8 Jun 2001 19:03:23 +0000 (19:03 +0000)
2001-06-08  Havoc Pennington  <hp@redhat.com>

* gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
function

* gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
this function

15 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/tmpl/gtk-unused.sgml
docs/reference/gtk/tmpl/gtkcontainer.sgml
docs/reference/gtk/tmpl/gtkrc.sgml
gtk/gtktextbuffer.c
gtk/gtktextbuffer.h
gtk/gtktextiter.c
gtk/gtktextview.c
gtk/gtktextview.h

index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index c0cfe00bb0ecfc4e9d7548355354d6a48d17f55d..d843b4253702df0bb1e5f14360a54fccefb834bf 100644 (file)
@@ -1,3 +1,11 @@
+2001-06-08  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbuffer.c (gtk_text_buffer_get_start_iter): added this
+       function
+
+       * gtk/gtktextview.c (gtk_text_view_get_default_attributes): added
+       this function
+
 2001-06-08  Alex Larsson  <alexl@redhat.com>
 
        * gtk/gtkcompat.h.in:
@@ -5,7 +13,7 @@
        Fixes bug #52892
 
 2001-06-08  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtkhsv.h (struct _GtkHSVClass): had GtkContainerClass as
        parent still
 
index 85536fc79b56f74bbee24865b772403cfe9adaf8..ae135db43f2d9c09623d62cf1db35497d1babbd1 100644 (file)
@@ -1005,6 +1005,15 @@ is enabled.
 @colorsel: 
 @use_palette: 
 
+<!-- ##### FUNCTION gtk_container_focus ##### -->
+<para>
+
+</para>
+
+@container: 
+@direction: 
+@Returns: 
+
 <!-- ##### FUNCTION gtk_ctree_construct ##### -->
 <para>
 This function is not usually used by users.
index c3e926c6ed00839b80cf714d753abd5f50b14146..4632a7f11b2bc4266e2a953061ec84a93754a71a 100644 (file)
@@ -101,16 +101,6 @@ GtkContainer
 @Returns: 
 
 
-<!-- ##### FUNCTION gtk_container_focus ##### -->
-<para>
-
-</para>
-
-@container: 
-@direction: 
-@Returns: 
-
-
 <!-- ##### FUNCTION gtk_container_set_reallocate_redraws ##### -->
 <para>
 
index e6727ce3567970f32fd86a971e9b5b746381bc32..244dd09a1bca866259b53772cbe85b3578ab2097 100644 (file)
@@ -495,6 +495,7 @@ This can later be composited together with other
 #GtkRcStyle structures to form a #GtkStyle.
 </para>
 
+@parent_instance: 
 @name: 
 @bg_pixmap_name: 
 @font_desc: 
index 4de2827fcca4273900f04c88c0e978119a3d577b..961fbf06335598d54997828348bdee1a7636a058 100644 (file)
@@ -2324,6 +2324,26 @@ gtk_text_buffer_get_iter_at_offset         (GtkTextBuffer      *buffer,
   _gtk_text_btree_get_iter_at_char (get_btree (buffer), iter, char_offset);
 }
 
+/**
+ * gtk_text_buffer_get_start_iter:
+ * @buffer: a #GtkTextBuffer
+ * @iter: iterator to initialize
+ *
+ * Initialized @iter with the first position in the text buffer. This
+ * is the same as using gtk_text_buffer_get_iter_at_offset() to get
+ * the iter at character offset 0.
+ * 
+ **/
+void
+gtk_text_buffer_get_start_iter (GtkTextBuffer *buffer,
+                                GtkTextIter   *iter)
+{
+  g_return_if_fail (iter != NULL);
+  g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
+
+  _gtk_text_btree_get_iter_at_char (get_btree (buffer), iter, 0);
+}
+
 /**
  * gtk_text_buffer_get_end_iter:
  * @buffer: a #GtkTextBuffer 
@@ -2333,7 +2353,7 @@ gtk_text_buffer_get_iter_at_offset         (GtkTextBuffer      *buffer,
  * character in the text buffer. If dereferenced with
  * gtk_text_iter_get_char(), the end iterator has a character value of
  * 0. The entire buffer lies in the range from the first position in
- * the buffer (call gtk_text_buffer_get_iter_at_offset() to get
+ * the buffer (call gtk_text_buffer_get_start_iter() to get
  * character position 0) to the end iterator.
  * 
  **/
index 4368d242aa174a37c1c994f5766e4c6e831cf29b..bfaafd2206fccfb3f31b778bffd6e28f87954a00 100644 (file)
@@ -296,6 +296,8 @@ void gtk_text_buffer_get_iter_at_offset      (GtkTextBuffer *buffer,
 void gtk_text_buffer_get_iter_at_line        (GtkTextBuffer *buffer,
                                               GtkTextIter   *iter,
                                               gint           line_number);
+void gtk_text_buffer_get_start_iter          (GtkTextBuffer *buffer,
+                                              GtkTextIter   *iter);
 void gtk_text_buffer_get_end_iter            (GtkTextBuffer *buffer,
                                               GtkTextIter   *iter);
 void gtk_text_buffer_get_bounds              (GtkTextBuffer *buffer,
index 9702a0b570ac7ebcdc40ab9c23933ce24746b0f8..ae7dfecf11ced03ab0f7a02b6c494f7472ca5f20 100644 (file)
@@ -1629,12 +1629,14 @@ gtk_text_iter_get_bytes_in_line (const GtkTextIter   *iter)
  *
  * Computes the effect of any tags applied to this spot in the
  * text. The @values parameter should be initialized to the default
- * settings you wish to use if no tags are in effect.
+ * settings you wish to use if no tags are in effect. You'd typically
+ * obtain the defaults from gtk_text_view_get_default_attributes().
+ *
  * gtk_text_iter_get_attributes () will modify @values, applying the
  * effects of any tags present at @iter. If any tags affected @values,
- * the function returns TRUE.
+ * the function returns %TRUE.
  *
- * Return value: TRUE if @values was modified
+ * Return value: %TRUE if @values was modified
  **/
 gboolean
 gtk_text_iter_get_attributes (const GtkTextIter  *iter,
index 99da996ca55089fff45ec3d0a4a33b11581d04fb..c90d2d0b5879ae7e3b42cb3f63b393d0f6b01c11 100644 (file)
@@ -4410,6 +4410,31 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
     }
 }
 
+/**
+ * gtk_text_view_get_default_attributes:
+ * @text_view: a #GtkTextView
+ * 
+ * Obtains a copy of the default text attributes. These are the
+ * attributes used for text unless a tag overrides them.
+ * You'd typically pass the default attributes in to
+ * gtk_text_tag_get_attributes() in order to get the
+ * attributes in effect at a given text position.
+ *
+ * The return value is a copy owned by the caller of this function,
+ * and should be freed.
+ * 
+ * Return value: a new #GtkTextAttributes
+ **/
+GtkTextAttributes*
+gtk_text_view_get_default_attributes (GtkTextView *text_view)
+{
+  g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL);
+  
+  gtk_text_view_ensure_layout (text_view);
+
+  return gtk_text_attributes_copy (text_view->layout->default_style);
+}
+
 static void
 gtk_text_view_destroy_layout (GtkTextView *text_view)
 {
index 3455655d9d6c96e75abd5fc9df367f8e62a418f3..66165b3dbff58af886b605b410b6eb325603568d 100644 (file)
@@ -316,8 +316,9 @@ gint             gtk_text_view_get_indent             (GtkTextView      *text_vi
 void             gtk_text_view_set_tabs               (GtkTextView      *text_view,
                                                        PangoTabArray    *tabs);
 PangoTabArray*   gtk_text_view_get_tabs               (GtkTextView      *text_view);
-                                       
 
+/* note that the return value of this changes with the theme */
+GtkTextAttributes* gtk_text_view_get_default_attributes (GtkTextView    *text_view);
 
 #ifdef __cplusplus
 }